#-*- coding:utf-8 -*-
import  urllib2
import  ssl
import json
import time
import top.api
import
ssl._create_default_https_context = ssl._create_unverified_context
def getlist():
    req = urllib2.urlopen('https://kyfw.12306.cn/otn/leftTicket/query?leftTicketDTO.train_date=2017-03-18&leftTicketDTO.from_station=CQW&leftTicketDTO.to_station=SZQ&purpose_codes=ADULT')
    html =  req.read()
    dict = json.loads(html)
    return dict['data']
list_s =  getlist()[0]
while list_s['queryLeftNewDTO']['rw_num'] ==u'无':
    print(1)
    time.sleep(5)
    continue

start_time = list_s['start_time']
station_train_code = list_s['station_train_code']
print list_s['queryLeftNewDTO']['station_train_code']+"*******"+list_s['queryLeftNewDTO']['yw_num']